<#compress>
    <#assign actionname>${(action=='create')?string('新建','编辑')}</#assign>
    <@override name="title">${actionname}品牌活动</@override>
    <@override name="viewcss">
    <link rel="stylesheet" href="${ctx}/static/scripts/plugins/bootstrap-switch/css/bootstrap-switch.min.css" type="text/css" />
    </@override>
    <@override name="viewbody">
    <div class="row">
        <div class="col-md-12">
            <h3 class="page-title">
            ${actionname}活动管理
                <small>${actionname}商场活动.</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="${ctx}/admin/home">
                        首页
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="${ctx}/admin/brandActivity">
                        商场活动管理
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#"> ${actionname}商场活动 </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="portlet box blue">
        <div class="portlet-title">
            <div class="caption">
                <i class="fa fa-reorder"></i> 商场活动信息
            </div>
        </div>

        <div class="portlet-body">
            <form class="form-horizontal" action="${ctx}/admin/activity/activityMall/save" role="form" id="actMallForm"
                  method="post">
                <input name="activity.id" type="hidden" value="${(activity.id)!}"/>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="brandName">活动名称: <span
                            class="required">*</span></label>

                    <div class="col-sm-10">
                        <input type="text" class="required form-control input-xlarge" placeholder="活动名称"
                               name="activity.name" id="brandName" value="${(activity.name)!}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="begin_time">开始时间: <span
                            class="required">*</span></label>

                    <div class="col-sm-10">
                        <div class="input-group input-medium date form_datetime" data-link-field="begin_time">
                            <input class="required form-control" size="16" type="text" value="${(activity.begin_time)!}" name="activity.begin_time"
                                   id="begin_time">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                        </div>
                        <input type="hidden" id="activity.begin_time" name="begin_time" value="">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="end_time">结束时间: <span class="required">*</span></label>

                    <div class="col-sm-9">
                        <div class="input-group input-medium date form_datetime "
                             data-link-field="end_time">
                            <input class="required form-control" size="16" type="text" value="${(activity.end_time)!}"
                                   name="activity.end_time" id="end_time">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                        </div>
                        <input type="hidden" id="activity.end_time" name="end_time" value=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label" for="picture_image_btn">活动图片: </label>

                    <div class="col-md-10">
                        <div class="fileinput fileinput-exists">
                            <input type="hidden" value="${activity.picture!}" name="activity.picture">

                            <div class="fileinput-btn">
                                <span class="btn default btn-file" >
                                    <span class="fileinput-new" id="picture_image_btn">&nbsp;</span>
                                </span>
                                <#if activity.picture??><a href="#" data-data="${activity.picture}" class="btn default fileinput-exists fileinput-remove">删除图片</a></#if>
                            </div>
                            <div class="fileinput-preview thumbnail"
                                 style="width: 200px; height: 150px; line-height: 150px;">
                                <#if activity.picture??><a href="${ctx}${activity.picture}" class="thumbnail fancybox-button">
                                    <img class="" src="${ctx}${activity.picture?replace('.','.thumbnail.')}" alt="">
                                </a></#if>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="description">活动描述:</label>

                    <div class="col-sm-10">
                        <textarea id="description_editor" name="activity.description"  style="width:350px;">${(activity.description)!'请输入活动描述'}</textarea>
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-sm-2 control-label">允许报名:<span class="required">*</span></label>

                    <div class="col-sm-10">
                        <input type="checkbox" name="enroll" <#if activity.is_enroll?? && activity.is_enroll>checked</#if> class="make-switch switch-large"
                               data-label-icon="fa fa-fullscreen" data-on-label="<i class='fa fa-check'></i>" data-off-label="<i class='fa fa-times'></i>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="end_time">允许评论: <span class="required">*</span></label>

                    <div class="col-sm-9">
                        <input type="checkbox" name="reply" <#if activity.reply?? && activity.reply>checked</#if> class="make-switch switch-large"
                               data-label-icon="fa fa-fullscreen" data-on-label="<i class='fa fa-check'></i>" data-off-label="<i class='fa fa-times'></i>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="seq_field">次序: <span class="mandatory">*</span></label>

                    <div class="col-sm-9">
                        <div id="spinner1">
                            <div class="input-group input-small">
                                <input type="text" class="required spinner-input form-control " id="seq_field" name="activity.seq"
                                       value="${activity.seq!}"
                                       maxlength="3" readonly>

                                <div class="spinner-buttons input-group-btn btn-group-vertical">
                                    <button type="button" class="btn spinner-up btn-xs blue">
                                        <i class="fa fa-angle-up"></i>
                                    </button>
                                    <button type="button" class="btn spinner-down btn-xs blue">
                                        <i class="fa fa-angle-down"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="floor_mall">所属购物中心: </label>

                    <div class="col-sm-10">
                        <select data-placeholder="选择购物中心" name="activity.mall" id="floor_mall"
                                class="required form-control input-xlarge select2me">
                            <#if mallblock??>
                                <#list mallblock as mb>
                                    <option value="${mb.id}"
                                            <#if (activity.mall)?? && (activity.mall) == mb.id>selected="selected"</#if> >${(mb.name)!}
                                        --${mb.blockname}</option>
                                </#list>
                            </#if>
                        </select>
                        <span class="help-block" id="malldesc">购物中心--所属集团.</span>
                    </div>
                </div>

                <div class="form-actions text-right">
                    <a class="btn default yellow-stripe" href="${ctx}/admin/activity/activityMall"><i
                            class="fa fa-arrow-circle-o-left"></i> 返回</a>
                    <input type="submit" value="保存" class="btn btn-primary">
                </div>

            </form>
        </div>

    </div>
    </@override>



    <@override name="viewmodule">activity_mall_item</@override>
    <@extends name="../../_basic/main.ftl"></@extends>
</#compress>